<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.12/vue.js"></script>
</head>
<body>
<div id="app">
    <Teacher></Teacher>
    <Student></Student>
</div>
<script>
    Vue.config.productionTip = false
    const Teacher = {
        template:`
            <div>
                <h2>Teacher组件</h2>
                <button>Teacher按钮</button>
            </div>
        `
    }
    const Student = {
        template:`
            <div>
                <School></School>
                <h2>Student组件</h2>
                <button>Student按钮</button>
            </div>
        `
    }

    //全局组件
    const School = {
        template:`
        <div>
           <h2>School组件</h2>
           <button>School按钮</button>
        </div>
        `
    }
    Vue.component('School',School)
    const vm = new Vue({
        el: '#app',
        data() {
            return {}
        },
        components:{
            Teacher,
            Student
        }
    })
</script>
</body>
</html>